package com.example.mqtt.server;

import com.example.mqtt.server.netty.MqttServerThread;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * Springboot+Netty搭建MQTT协议的服务端(基础Demo)：https://huaweicloud.csdn.net/63875298dacf622b8df8acad.html
 * Netty实战入门详解——让你彻底记住什么是Netty（看不懂你来找我）：https://www.cnblogs.com/nanaheidebk/p/11025362.html
 */
@SpringBootApplication
public class BootNettyMqttApplication implements CommandLineRunner {
    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(BootNettyMqttApplication.class);
        app.run(args);
    }

    @Override
    public void run(String... args) throws Exception {
        // 启动  1883
        int port = 1883;
        MqttServerThread bootNettyMqttServerThread = new MqttServerThread(port);
        bootNettyMqttServerThread.start();
    }
}